-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🪟 🔧 Add additional eslint rules #17348
Conversation
The rules look good but looks like there are some build things with the e2e tests failing. |
The changes from |
Could you please specify which removed |
My statement was based on us having failing tests, so I hedged that was the reason. If tests are passing then it seems like we're good. 👍 |
* Add additional eslint rules * Add comment * Restore async await act * Fix broken gradle reference
What
This adds two rules improving on TypeScript code:
@typescript-eslint/no-unnecessary-type-assertion
which prevents us from doingfoo!.bar
iffoo
can't benull
/undefined
and that way basically weakening type checks if it later would change to be able to benull
/undefined
.@typescript-eslint/await-thenable
, which prevents us from usingawait
for statements that are not returning a promise. I also removed all violations of this rule.How
I needed to move the
.eslintrc
file to.eslintrc.js
since I required access to__dirname
for that path to work properly no matter if you run lint via the command line or via VSCode.Since those new rules require eslint to properly parse our project to have all type information, they can only apply to files in
src/
(which are part of out typescript project), thus they went into a separate overwrites.